home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_11_03 / 1103107a < prev    next >
Text File  |  1993-01-06  |  335b  |  35 lines

  1. #include <iostream.h>
  2.  
  3. class B
  4.     {
  5. public:
  6.     void f();
  7.     void g();
  8.     };
  9.  
  10. void B::f() { cout << "B::f()\n"; }
  11.  
  12. void B::g() { cout << "B::g()\n"; }
  13.  
  14. class D : public B
  15.     {
  16. public:
  17.     void g();
  18.     };
  19.  
  20. void D::g() { cout << "D::g()\n"; }
  21.  
  22. int main()
  23.     {
  24.     B b;
  25.     b.f();
  26.     b.g();
  27.     D d;
  28.     d.f();
  29.     d.g();
  30.     return 0;
  31.     }
  32.  
  33.  
  34.  
  35.